<template> 
		<el-row :gutter="5">  
			<el-col :span="toggle?0:6" v-show="toggle==false"> 
				<xm-phase :xm-product="xmProduct" :sel-project="selProject"  @check-change="onPhaseRowClick" @project-select="{project=$event;parentTask=null}" @project-clear="{project=null;parentTask=null}"/>
			</el-col>
			<el-col :span="toggle?24:18">
				<xm-task-mng :xm-product="xmProduct" :sel-project="project" :params="{ntype:'0'}" :parent-task="parentTask" queryScope="task" >
				<template #expandBtn>
					<el-button :icon="toggle?'DArrowRight':'DArrowLeft'" @click="onToggleClick" plain title="展开/收起左边"/>
				</template>
			</xm-task-mng>
			</el-col>
		</el-row>
	
</template>

<script>

	import  XmPhase from '@/views/xm/core/xmTask/XmPhase.vue';//新增界面
 	import  XmTaskMng from '@/views/xm/core/xmTask/XmTaskMng.vue';//新增界面
	import util from '@/components/mdp-ui/js/util';//全局公共库
	import { mapState } from 'pinia'
import { useUserStore } from '@/store/modules/user'

	export default {

		components: {
			XmPhase,XmTaskMng
		},
        props:['xmProduct','selProject'],//queryScope='plan|task'
		computed: {
		    ...mapState(useUserStore,[
		      'userInfo','roles'
		    ]),


        },
		watch: {

	    },
		data() {
			return {
				parentTask:null,  
				project:null,
				toggle: true,
				hadInit: false, 
			}//end return
		},//end data
		methods: {
			 
			 onToggleClick(){
				 this.toggle=!this.toggle
				 if(!this.hadInit){
					 this.hadInit=true
				 }
				},
			 onPhaseRowClick(task,checked){
				if(checked==true){
					this.parentTask=task
				}else{
					this.parentTask=null
				}
				 
			 }
		},//end method
		mounted() {
			this.project=this.selProject

		}//end mounted
	}

</script>

<style lang="less" scoped />
